package com.example.comiccenter.utils;

import lombok.Data;

@Data
public class ResultData {
    private Integer code;
    private String msg;
    private Object data;

    public ResultData(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static  ResultData success(String msg){
        return new ResultData(200,msg,null);
    }

    public static  ResultData success(String msg,Object data){
        return new ResultData(200,msg,data);
    }

    public static  ResultData error(Integer code,String msg,Object data){
        return new ResultData(code,msg,data);
    }

    public static  ResultData error(Integer code,String msg){
        return new ResultData(code,msg,null);
    }



}
